package com.tenement.entity;

import com.mybatisflex.annotation.*;

import java.io.Serializable;
import java.sql.Timestamp;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;

/**
 *  实体类。
 *
 * @author BertXie
 * @since 1.0.1
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(value = "sys_post",dataSource = "tenement")
public class Post implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id(keyType = KeyType.Generator, value = "snowFlakeId")
    @ColumnAlias(value = "postId")
    private Long id;

    private String code;

    @NotBlank(message = "岗位名称不能为空")
    @ColumnAlias(value = "postName")
    private String name;

    private Short sortOrder;

    private Short status;

    private Long creator;

    @Column(onInsertValue = "now()")
    private Timestamp createTime;

    @Column(onUpdateValue = "now()")
    private Timestamp updateTime;

    private String remark;

    @Column(tenantId = true)
    private Long tenementId;

}
